package Work4.Slay_the_Maze.Monsters;

import java.util.Random;

import Work4.Slay_the_Maze.Cards.Cards;
import Work4.Slay_the_Maze.Cards.attack;
import Work4.Slay_the_Maze.Monsters.InterFace.*;
import Work4.Slay_the_Maze.Player.Player;

public class Demon extends Monster implements Strengthening {
	public Demon() {
		super("恶魔",80);
	}
	public Demon(Demon other) {
        // 调用父类的构造函数，复制父类属性
        super(other.getName(), other.getHP());
    }

    // 克隆方法
    @Override
    public Monster clone() {
        return new Demon(this);  // 使用拷贝构造函数
    }
    @Override
    public void Action(Player player,Monster monster) {
        int temp;
        int moredamage=0;
        Random rd=new Random();
       	temp=rd.nextInt(100)+1;
       	if(temp>=1&&temp<=70) {
       		int attnum=attack(player);
       		if(moredamage>0) {
       			player.damage(moredamage);
       			attnum+=moredamage;
       			moredamage=0;
       		}
        	System.out.println("恶魔使用爪击，造成"+attnum+"伤害");
       	}else if(temp>70&&temp<=90){
       		int attnum=attack(player);
       		if(moredamage>0) {
       			player.damage(moredamage);
       			attnum+=moredamage;
       			moredamage=0;
       		}
       		player.damage(10);
       		attnum+=10;
       		System.out.println("恶魔使用火球术，造成"+attnum+"伤害");
       	}else if(temp>90&&temp<=100) {
       		moredamage+=10;
        	System.out.println("恶魔使用强化，他的下次额外造成10点伤害");
        }
    }
    @Override
    public int attack(Player target) {
        Random rd=new Random();
        int attnum=rd.nextInt(21)+15;
        target.damage(attnum);
        return attnum;
    }
    @Override
    public void Strengthening() {
        System.out.println(getName() + " 释放腐蚀液体，削弱敌人防御！");
    }
}
